package cn.jeeweb.modules.web.labor.service.impl;

import cn.jeeweb.core.common.service.impl.CommonServiceImpl;
import cn.jeeweb.core.query.data.Page;
import cn.jeeweb.core.query.data.PageImpl;
import cn.jeeweb.core.query.data.Pageable;
import cn.jeeweb.core.query.data.Queryable;
import cn.jeeweb.core.query.parse.QueryToWrapper;
import cn.jeeweb.modules.web.labor.content.HuEmployTrainContent;
import cn.jeeweb.modules.web.labor.content.HuSubsidyContent;
import cn.jeeweb.modules.web.labor.mapper.HuEmployTrainMapper;
import cn.jeeweb.modules.web.labor.entity.HuEmployTrain;
import cn.jeeweb.modules.web.labor.service.IHuEmployTrainService;
import com.baomidou.mybatisplus.mapper.Wrapper;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

/**   
 * @Title: hu_employ_train
 * @Description: hu_employ_train
 * @author &Iacute;&otilde;&acute;&aelig;&frac14;&ucirc;
 * @date 2018-02-24 09:20:06
 * @version V1.0   
 *
 */
@Transactional
@Service("huEmployTrainService")
public class HuEmployTrainServiceImpl  extends CommonServiceImpl<HuEmployTrainMapper,HuEmployTrain> implements  IHuEmployTrainService {


    @Resource
    private HuEmployTrainMapper huEmployTrainMapper;



    public Page<HuEmployTrainContent> selectSubsidyPage(Queryable queryable, Wrapper<HuEmployTrainContent> wrapper){
        QueryToWrapper<HuEmployTrainContent> queryToWrapper = new QueryToWrapper<HuEmployTrainContent>();
        queryToWrapper.parseCondition(wrapper, queryable);
        // 排序问题
        queryToWrapper.parseSort(wrapper, queryable);
        Pageable pageable = queryable.getPageable();
        com.baomidou.mybatisplus.plugins.Page<HuEmployTrainContent> content = new com.baomidou.mybatisplus.plugins.Page<HuEmployTrainContent>(
                pageable.getPageNumber(), pageable.getPageSize());
        List<HuEmployTrainContent> list=huEmployTrainMapper.selectTrainList(content);
        content.setRecords(list);
        return new PageImpl<HuEmployTrainContent>(content.getRecords(), queryable.getPageable(), content.getTotal());
    }

}
